def longestCommonPrefix(strs: str):
    s = ""
    for i in zip(*strs):
        if len(set(i)) == 1:
            s += i[0]
        else:
            break
    return s

str = []
f = open('longestPrefix.txt','r')
for each_line in f.readlines():
    str.append(each_line)
print(longestCommonPrefix(str))
f.close()